package com.niodata.dp.core.usermgr;

import com.niodata.dp.core.exception.DpException;

/**
 * 用户管理模块异常.
 */
public class DpUsermgrException extends DpException {

  private final int code;
  private final String message;

  public DpUsermgrException(int code, String message, Throwable cause) {
    super(message, cause);
    this.code = code;
    this.message = message;
  }

  public DpUsermgrException(int code, String message) {
    super(message, null);
    this.code = code;
    this.message = message;
  }

  public int getCode() {
    return code;
  }

  public String getMessage() {
    return message;
  }

  @Override
  public int errorCode() {
    return this.code;
  }
}
